import Mock from 'mockjs';

export function mock() {
    // 用户信息
    Mock.mock(/user\/info/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            id: 123,
            nickname: '昵称',
            avatar: 'https://static.playground.forzoom.tech/meta/square/1.jpg',
            level: 0,
            referrer_id: 23,
            invite_code: 1234123,
            mobile: '13902939102',
            has_order: 0,
            shop: '商铺名',
            employee_identity: '商家职员',
            position: '职位',
            name: '真名',
        },
    });

    // 基础信息
    Mock.mock(/user\/base_info/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            nickname: '12342',
            avatar: 'https://static.playground.forzoom.tech/meta/square/1.jpg',
            level: 1,
        },
    });

    // 更新用户信息
    Mock.mock(/user\/sync_user_info/, 'post', {
        status: 0,
        message: 'OK',
        data: {

        },
    });

    // 获取有邀请候选人
    Mock.mock(/user\/referrer_list/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 1,
                nickname: '昵称',
                mobile: '123********',
                name: 'xxx',
            },
        ],
    });

    // 检查邀请人
    Mock.mock(/user\/check_referrer/, 'post', {
        status: 0,
        message: 'OK',
        data: {
            id: 1,
            name: 'xxx',
            mobile: '123********',
        },
    });

    // 获取推荐人信息
    Mock.mock(/user\/referrer/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            id: 1,
            nickname: 'xxx',
            mobile: '123********',
        },
    });

    // 记录访客
    Mock.mock(/user\/visitor/, 'post', {
        status: 0,
        message: 'OK',
    });

    // 获取解锁金额
    Mock.mock(/user\/unlock/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            unlock: 123,
            lock: 123,
        },
    });

    // 获取账户
    Mock.mock(/user\/account/, 'get', {
        status: 0,
        message: 'OK',
        data: 123,
    });

    // 获取账户排行
    Mock.mock(/user\/account_rank/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            max: 123,
            rank: 123,
        },
    });

    // 获取账户流水
    Mock.mock(/user\/account_detail/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                title: '奖金',
                money: 123,
                from: 'account',
                to: 'system',
                account: 123,
                created_at: '2019-01-02 12:23:01',
            },
        ],
    });

    // 设置默认地址
    Mock.mock(/user\/set_default_address/, 'get', {
        status: 0,
        message: 'OK',
    });

    // 获取默认地址
    Mock.mock(/user\/default_address/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            title: '公司',
            name: '皇上',
            mobile: '110',
            province: '北京',
            city: 'xxx',
            district: '东城区',
            detail: '长安街1号',
            is_default: 0,
        },
    });

    // 获取地址列表
    Mock.mock(/user\/address_list/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                title: '公司',
                name: '皇上',
                mobile: '110',
                province: '北京',
                city: 'xxx',
                district: '东城区',
                detail: '长安街1号',
                is_default: 0,
            },
        ],
    });

    // 添加地址
    Mock.mock(/user\/address/, 'post', {
        status: 0,
        message: 'OK',
    });

    // 更新地址
    Mock.mock(/user\/update_address/, 'post', {
        status: 0,
        message: 'OK',
    });

    // 删除地址
    Mock.mock(/user\/address\/delete/, 'post', {
        status: 0,
        message: 'OK',
    });

    // 获取可赠送优惠券列表
    Mock.mock(/user\/coupon/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 123,
                name: 'xxx',
                shop_id: 123,
                shop: 'xxx',
                created_at: '2018-01-01 12:01:21',
                money: 21,
                shelf_life: 123,
                share_image: 'http://www.baidu.com/share_image.jpg',
            },
        ],
    });

    // 获取商品使用的优惠券列表
    Mock.mock(/user\/goods_coupon/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 123,
                name: 'www',
                shop_id: 123,
                shop: '',
                created_at: '2018-01-01 12:01:21',
                money: 21,
                shelf_life: 123,
                share_image: 'http://www.baidu.com/share_image.jpg',
            },
        ],
    });

    // 获取优惠券列表
    Mock.mock(/user\/usable_coupon/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 12,
                type: 'package',
                shop_name: "店铺名",
                title: '',
                price_limit: 123,
                money: 12,
                expiration_date: '2018-01-01',
                use_id: 12,
                use_time: '2021-10-12 13:20:40',
            },
        ],
    });

    // 获取赠送码
    Mock.mock(/user\/give_coupon/, 'get', {
        status: 0,
        message: 'OK',
        data: 'xxx',
    });

    // 领取赠送的优惠券
    Mock.mock(/user\/take\/coupon/, 'get', {
        status: 0,
        message: 'OK',
        data: 'xxx',
    });

    // 绑定手机
    Mock.mock(/user\/mobile/, 'post', {
        status: 0,
        message: 'OK',
        data: 'xxx',
    });

    // 申请合伙人
    Mock.mock(/user\/apply_partner/, 'get', {
        status: 0,
        message: 'OK',
        data: 'xxx',
    });

    // 获取申请信息
    Mock.mock(/user\/partner\/application/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            partner_id: 123,
            personal_id: 123,
            name: '姓名',
            id_number: '214418724127208427443',
            address: '地址',
            company: '公司',
            job: '工作',
            image: 'http://www.baidu.com/image.jpg',
            id_card_positive: 'http://www.baidu.com/image.jpg',
            id_card_back: 'http://www.baidu.com/image.jpg',
            status: 'init',
            reason: 'xxx',
        },
    });

    // 邀请统计
    Mock.mock(/user\/invitation_statistic/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            invite_number: 123,
            no_deal: 123,
            order_number: 234,
        },
    });

    // 录入账号信息
    Mock.mock(/user\/bank/, 'post', {
        status: 0,
        message: 'OK',
    });

    // 获取账号信息
    Mock.mock(/user\/bank/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            id: 23,
            name: '姓名',
            no: '21984321074091270',
            bank_name: '招商银行黄泉路支行',
        },
    });

    // 申请提现
    Mock.mock(/user\/apply\/withdrawal/, 'post', {
        status: 0,
        message: 'OK',
    });

    // 提现列表
    Mock.mock(/user\/apply\/withdrawal_detail/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                title: '提现',
                money: 123424,
                status: 'init',
                created_at: '2019-10-10 12:10:10',
            },
        ],
    });

    // 我邀请的用户列表
    Mock.mock(/user\/invited/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 23,
                nickname: 'ssf',
                avatar: 'http://www.baidu.com/avatar.jpg',
                mobile: '',
                has_coupon: 0,
            },
        ],
    });

    // 获取邀请排行
    Mock.mock(/user\/visitor\/rank/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                nickname: '23123',
                avatar: 'http://www.baidu.com',
                score: 123,
                rank: 123,
            },
        ],
    });

    // 获取解锁排行榜
    Mock.mock(/user\/unlock\/rank/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                nickname: '23123',
                avatar: 'http://www.baidu.com',
                score: 123,
            },
        ],
    });

    // 获取分享排行
    Mock.mock(/user\/share/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                nickname: '23123',
                avatar: 'http://www.baidu.com',
                score: 123,
            },
        ],
    });

    // 获取jssdk
    Mock.mock(/user\/js_sdk_config/, 'get', {
        status: 0,
        message: 'OK',
    });

    // 获取团队信息
    Mock.mock(/user\/team/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            lock: 123,
            unlock: 123,
            rebate: 123,
            invite: 123,
            no_deal: 123,
            deal: 123,
        },
    });

    // 搜索用户
    Mock.mock(/user\/search/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                nickname: '姓名',
                id: 123,
            },
        ],
    });

    // 获取返利会员店铺信息
    Mock.mock(/user\/member/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                shop_id: 1,
                shop: '店铺名',
                cover: 'https://static.playground.forzoom.tech/meta/square/1.jpg',
                quota: 12414, // 总奖金池
                rebate: 12, // 已经解锁的奖金
            },
        ],
    });

    // 获取验证码
    Mock.mock(/user\/mobile_code/, 'get', {
        status: 0,
        message: 'OK',
        data: 123, // 验证码id
    });

    // 绑定电话
    Mock.mock(/user\/bind_mobile/, 'get', {
        status: 0,
        message: 'OK',
    });

    // 搜索用户
    Mock.mock(/user\/search/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 1,
                nickname: 'xxx',
            },
        ]
    });
}
